<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 数据表格</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        th ,td{
            text-align: center;
            width:278px;
        }
        #layer-date{
            position: absolute;
            left:100px;
            top:60px;
            z-index: 1000;
            padding: 0;
            margin-left: 200px;
            margin-top: -5px;
            margin-bottom: -31px;
            border: 0;
            width: 550px;
            float: left;
        }
    </style>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">

                    <form method="post" action="/bill" role="form" >
                        <div class="form-group" id="layer-date" >
                            <div class="col-sm-5" style="width: 220px;">
                                <input class="form-control layer-date"  name="start_date" value="" placeholder="请选择开始时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </div>
                            {!! csrf_field() !!}
                            <div class="col-sm-5" style="width: 220px;">
                                <input class="form-control layer-date" name="end_date" value="" placeholder="请选择结束时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </div>
                            <button class="btn btn-primary" style="margin-left: 15px; margin-top: 1px;" type="submit">查询</button>
                        </div>
                    </form>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                            <tr>
                                <th style="display:none;">ID</th>
                                <th>订单号</th>
                                <th>类型</th>
                                <th>时间</th>
                                <th>价格</th>
                                <th>套餐类型</th>
                                <th>余额</th>
                                <th>创建时间</th>
                            </tr>
                        </thead>
                        <tbody>
                        @if(!empty($data['orders']))
                            @foreach($data['orders'] as $key=>$value)
                                <tr class="gradeX">
                                    <td style="display:none;">{{ $key+1 }}</td>
                                    <td>{{ $value['order_no'] }}</td>
                                    <td>{{$value['account_type']}}</td>
                                    <td>{{$value['date']}}</td>
                                    <td class="center">{{ $value['price'] }}</td>
                                    <td class="center">{{ $value['set_type'] }}</td>
                                    <td class="center">{{ $value['balance'] }}</td>
                                    <td class="center">{{ $value['created_at'] }}</td>
                                </tr>
                            @endforeach
                        </tbody>
                        @else
                        <tfoot>
                            <tr>
                                <th colspan="5">还没有任何信息哦！</th>
                            </tr>
                        </tfoot>
                        @endif
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>



<script src="js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>


<script src="js/plugins/layer/laydate/laydate.js"></script>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        $('.dataTables-example').dataTable();

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });


    });

    function fnClickAddRow() {
        $('#editable').dataTable().fnAddData([
            "Custom row",
            "New row",
            "New row",
            "New row",
            "New row"]);

    }
</script>




</body>

</html>
